home *** CD-ROM | disk | FTP | other *** search
/ Inventor Labs: Technology / INVENTORLABS_TECHNOLOGY.BIN / mac / FILES / SHARED.CST / 00143_Script_Main Movie Script < prev    next >
Text File  |  1997-07-24  |  4KB  |  115 lines

  1. -- Main Movie Scripts
  2. --
  3. -- For basic QTVR use this castmember includes most of the scripts you need
  4. -- Not included are the calls to the "openQTVRMovie" handler and
  5. -- a frame script to display the movie and allow the user to interact with 
  6. -- it (see "Movie Display Frame Script").
  7. --------------------------------------------------------------------------
  8.  
  9. --=============================================================
  10. -- StartMovie
  11. -- 
  12. -- Sets up things for QTVR. You only want to do this once,
  13. -- so if you've got multiple Director movies in your project
  14. -- put these calls in some kind of initialization handler.
  15. ---------------------------------------------------------------
  16.  
  17. global gQTVRInstance, gQTVRObj
  18.  
  19. --on StartMovie
  20. --  global gQTVRObj
  21. --  set gTheXtra = xtra "QTVRXtra"
  22. --  -- register the Quicktime VR component
  23. --  QTVREnter(xtra "QTVRXtra")
  24. --
  25. --  -- create a new instance of the xtra
  26. --  set gQTVRObj = new(xtra "QTVRXtra")
  27. --
  28. --    put CallBackTracer(mNew) into QTVRCallBackFactory
  29. --    SetCallBack PanoMovie, QTVRCallBackFactory
  30. --
  31. --  
  32. --  preloadmember "FINALMIXAmb.LoopAiff"
  33. --  
  34. --end
  35. --
  36. --=============================================================
  37. -- StopMovie
  38. --
  39. -- This is important: be sure to  your movies when you stop.
  40. -- Otherwise they hang out taking up ram, even though you don't see them.
  41. -- This can be a real problem when in authoring mode, as you start and stop
  42. -- the movie over and over. When in doubt call QTVRClose from the message window.
  43. ---------------------------------------------------------------
  44. --on StopMovie
  45. --  global gQTVRObj
  46. --  
  47. --  -- Close any open QTVR movies
  48. --  QTVRClose(gQTVRObj)
  49. --  
  50. --  -- unregister the Quicktime VR component
  51. --  QTVRExit(xtra "QTVRXtra")
  52. --end
  53.  
  54. --=============================================================
  55. -- openQTVRMovie
  56. --
  57. -- Opens a pano or object movie.
  58. -- pMovieName is a full pathname to the movie (paltform-specific)
  59. -- pSprite is a sprite placholder with the size and location you want
  60. -- for your qtvr movie.
  61. --
  62. -- Note: This handler has no error checking. For an example handler with
  63. -- error checking, see the openMovie handler in the Testbed.
  64. ---------------------------------------------------------------
  65. on openQTVRMovie pMovieName, pSprite
  66.   global gQTVRObj
  67.   
  68.   -- Close any open QTVR movies
  69.   QTVRClose(gQTVRObj)
  70.   
  71.   -- rectToStr is a handler below
  72.   set tRect = rectToStr(the rect of sprite pSprite)
  73.   
  74.   put QTVROpen(gQTVRObj, pMovieName, tRect, "visible")
  75. end
  76.  
  77.  
  78. --=============================================================
  79. -- utilities
  80. --
  81. -- these handlers convert Lingo's rect and point variable types
  82. -- to strings for use by the xtra 
  83. ---------------------------------------------------------------
  84. on rectToStr myRect
  85.   set myString = string(myRect)
  86.   delete char 1 to 5 of myString
  87.   delete char (the length of myString) of myString
  88.   return myString
  89. end
  90.  
  91. on pointToStr myPoint
  92.   set myString = string(myPoint)
  93.   delete char 1 to 6 of myString
  94.   delete char (the length of myString) of myString
  95.   return myString
  96. end
  97.  
  98.  
  99. on hilite whereto
  100.   
  101.   set origclick = the clickon
  102.   set origmem = the membernum of sprite origclick
  103.   set the member of sprite origclick = origmem+ 1
  104.   updatestage
  105.   repeat while the mousedown
  106.     set the member of sprite origclick = origmem + rollover(origclick)
  107.     updatestage
  108.   end repeat
  109.   if the membernum of sprite origclick <> origmem  then
  110.     puppetsprite 4, true
  111.     go whereto
  112.   end if
  113.   
  114.   
  115. end hilite